﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;

namespace backend.Models;

public partial class MaintenanceMan
{
    [Key]
    [Column("M_ID")]
    [StringLength(8)]
    [Unicode(false)]
    public string MId { get; set; } = null!;

    // 工种
    [Column("P_ID")]
    [StringLength(8)]
    [Unicode(false)]
    public string PId { get; set; } = null!;

    [Column("M_Hiredate")]
    public DateOnly MHiredate { get; set; }

    [Column("M_FinishedRequests")]
    public int MFinishedRequests { get; set; }

    [Column("M_AverageResponseTime", TypeName = "decimal(4, 2)")]
    public decimal? MAverageResponseTime { get; set; }

    [Column("M_AverageQuality", TypeName = "decimal(4, 2)")]
    public decimal? MAverageQuality { get; set; }

    [Column("M_AverageAttitude", TypeName = "decimal(4, 2)")]
    public decimal? MAverageAttitude { get; set; }

    [Column("M_IsResigned")]
    public bool MIsResigned { get; set; }

    [ForeignKey("MId")]
    [InverseProperty("MaintenanceMan")]
    public virtual User MIdNavigation { get; set; } = null!;

    [InverseProperty("MIdNavigation")]
    public virtual ICollection<RepairRequest> RepairRequests { get; set; } = new List<RepairRequest>();
}
